package cn.tanghom.support.hook;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import cn.tanghom.content.model.Article;
import cn.tanghom.content.model.Dashboard;
import cn.tanghom.content.model.Report;
import cn.tanghom.support.web.BaseController;



/**
 * ArticleModule 为ArticleModule的扩展
 * @author Hunteron-cp
 *
 * @param <M>
 */
public class DashboardModule<M> extends AbstractModule<Dashboard>{	
	
	protected final String pluginModelName;
	
	
	
	public DashboardModule(String modelName){		
		this.pluginModelName = modelName;		
	}	
		
	
	//如果模型一样，则继续执行
	public boolean hook(String method, Object... params) { 
		Dashboard dash = (Dashboard)params[0];		
		if(pluginModelName.equalsIgnoreCase(dash.getType())){
			return true;			
		}		
		return false;
	} 	
	
	
	
	//加载仪表盘
	@Override
	public boolean loadModel(Dashboard dash){
		if(dash.getCid()!=null) return true;
		return false;
	}
	
	// 显示仪表盘
	@Override
	public boolean viewModel(Dashboard dash,BaseController c){			
		
		return true;
	}
	
	
}
